/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package mutual.entidades;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author yue
 */
@Entity
@Table(name = "Ciudades")
@NamedQueries({
    @NamedQuery(name = "Ciudades.findAll", query = "SELECT c FROM Ciudades c"),
    @NamedQuery(name = "Ciudades.findById", query = "SELECT c FROM Ciudades c WHERE c.id = :id"),
    @NamedQuery(name = "Ciudades.findByCiudad", query = "SELECT c FROM Ciudades c WHERE c.ciudad = :ciudad"),
    @NamedQuery(name = "Ciudades.findByProvincia", query = "SELECT c FROM Ciudades c WHERE c.provincia = :provincia"),
    @NamedQuery(name = "Ciudades.findByPais", query = "SELECT c FROM Ciudades c WHERE c.pais = :pais")})
public class Ciudades implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @Basic(optional = false)
    @Column(name = "ciudad")
    private String ciudad;
    @Basic(optional = false)
    @Column(name = "provincia")
    private String provincia;
    @Basic(optional = false)
    @Column(name = "pais")
    private String pais;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "ciudades")
    private Collection<Medicos> medicosCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "ciudades")
    private Collection<Socios> sociosCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "ciudades")
    private Collection<DependenciaUniversitaria> dependenciaUniversitariaCollection;

    public Ciudades() {
    }

    public Ciudades(Integer id) {
        this.id = id;
    }

    public Ciudades(Integer id, String ciudad, String provincia, String pais) {
        this.id = id;
        this.ciudad = ciudad;
        this.provincia = provincia;
        this.pais = pais;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getCiudad() {
        return ciudad;
    }

    public void setCiudad(String ciudad) {
        this.ciudad = ciudad;
    }

    public String getProvincia() {
        return provincia;
    }

    public void setProvincia(String provincia) {
        this.provincia = provincia;
    }

    public String getPais() {
        return pais;
    }

    public void setPais(String pais) {
        this.pais = pais;
    }

    public Collection<Medicos> getMedicosCollection() {
        return medicosCollection;
    }

    public void setMedicosCollection(Collection<Medicos> medicosCollection) {
        this.medicosCollection = medicosCollection;
    }

    public Collection<Socios> getSociosCollection() {
        return sociosCollection;
    }

    public void setSociosCollection(Collection<Socios> sociosCollection) {
        this.sociosCollection = sociosCollection;
    }

    public Collection<DependenciaUniversitaria> getDependenciaUniversitariaCollection() {
        return dependenciaUniversitariaCollection;
    }

    public void setDependenciaUniversitariaCollection(Collection<DependenciaUniversitaria> dependenciaUniversitariaCollection) {
        this.dependenciaUniversitariaCollection = dependenciaUniversitariaCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Ciudades)) {
            return false;
        }
        Ciudades other = (Ciudades) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return ciudad + ", " + provincia + ", " + pais;
    }

}
